﻿namespace ConsoleHost
{
    using DemoService;
    using System;
    using System.Linq;
    using System.ServiceModel;
    using WcfComposition;

    class Program
    {
        static void Main( string[] args )
        {
            var binding = new BasicHttpBinding( BasicHttpSecurityMode.None );
            var addresses = new Uri[1];
            addresses[0] = new Uri( "http://localhost:8000" );

            using ( var host = new ComposingServiceHost( typeof( ComposingService ), addresses ) )
            {
                host.Open();

                host.ChannelDispatchers.ToList().ForEach( dispatcher =>
                    {
                        Console.WriteLine( dispatcher.Listener.Uri );
                    } );

                Console.WriteLine( "Service is now open for business.  Begin with the requests." );
                Console.ReadLine();
            }
        }
    }
}
